﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Extensions
{
    public static class DateExtensions
    {
        /// <summary>
        /// Ermittelt den 01.01. des aktuellen Datetimejahres.
        /// </summary>
        public static DateTime FirstDayOfYear(this DateTime date)
        {
            return new DateTime(date.Year, 1, 1);
        }

        /// <summary>
        /// Ermittelt den 31.12. des aktuellen Datetimejahres.
        /// </summary>
        public static DateTime LastDayOfYear(this DateTime date)
        {
            return new DateTime(date.Year, 12, 31);
        }
    }

}
